#include"FM17550.h"


/**
 * @description: 获取时间戳
 * @return {*}
 */
uint32_t get_current_timestamp(void) {
    return uwTick;
}


/**
 * @description: 获取时间间隔
 * @param {uint32_t} pre
 * @return {*}
 */
uint32_t get_time_Interval(uint32_t pre) 
{
    if(uwTick >= pre) {
        return uwTick - pre;
    }
    else {
        return (0xffffffff - pre + uwTick + 1);
    }
}

/**
 * @description: 延时函数
 * @return {*}
 */
void delay_ms(const uint32_t times) {
    uint32_t pre = uwTick;
    while(get_time_Interval(pre) < times)
        ;
}

